package com.haohope.framework.wb.lock;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class DefaultVarLock extends VarLock{
	private Lock lock = new ReentrantLock();
	@Override
	public void _lock() {
		lock.lock();
	}
	@Override
	public void _lockInterruptibly() throws InterruptedException {
		lock.lockInterruptibly();
	}
	@Override
	public boolean _tryLock() {
		return lock.tryLock();
	}
	@Override
	public boolean _tryLock(long time, TimeUnit unit) throws InterruptedException {
		return lock.tryLock(time, unit);
	}
	@Override
	public void _unlock() {
		lock.unlock();
	}
}
